package com.qiaofang.collectmanage.constants;

import java.util.*;

/**
 * Copyright (C), 2002-2017, 上海巧房信息技术有限公司
 * FileName: PersonalHouseRentEnum
 * Author:   yi.li
 * Date:     2018/7/6 16:25
 * Description: 个人住宅出租字段
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
public enum PersonalHouseRentEnum {
    TITLE("title","标题"),
    TITLELINK("titleLink","标题链接"),
    DESC("desc","房源描述"),
    ROOMAREA("roomArea","面积"),
    HOUSETYPE("houseType","户型"),
    DIRECTION("direction","朝向"),
    DECORATION("decoration","装修"),
    ISSPLIT("isSplit","是否可分割"),
    HOUSINGTYPE("housingType","住宅类型"),
    ISREGISTER("isRegister","是否可注册公司"),
    FLOOR("floor","楼层"),
    TOTALFLOOR("totalFloor","总层"),
    PROPERTYFEE("propertyFee","物业费"),
    REGION("region","城区"),
    DISTRICT("district","商圈"),
    ESTATE("estate","楼盘字典"),
    ESTATELINK("estateLink","楼盘链接"),
    ADDRESS("address","楼盘地址"),
    CONTACTNAME("contactName","联系人"),
    CONTACTMOBILE("contactMobile","联系人电话"),
    IMGS("imgs","房源图片"),
    PUBLISHTIME("publishTime","发布时间"),
    CONFIGURE("configure","房屋配置"),
    TRADE("trade","交易"),
    PURPOSE("purpose","用途"),
    REMARK("remark","备注"),
    RENTPRICE("rentPrice","租价"),
    RENTUNIT("rentUnit","租价单位"),
    RENTMODE("rentMode","出租方式"),
    BEDROOM("bedRoom","卧室"),
    SEX("sex","性别要求"),
    PAYMODE("payMode","付款方式"),
    LABEL("lable","房源标签");

    /**
     * 枚举值
     */
    private String value;

    private String desc;

    PersonalHouseRentEnum(String value,String desc) {
        this.value = value;
        this.desc = desc;
    }
    /**
     * 判断是否存在枚举value
     */
    public static boolean valueExist(String value) {
        return Arrays.stream(PersonalHouseRentEnum.values()).anyMatch(obj -> obj.getValue().equals(value));
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static List<String> toValueList() {
        PersonalHouseRentEnum[] ary = PersonalHouseRentEnum.values();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < ary.length; i++) {
            list.add(ary[i].getValue());
        }
        return list;
    }
}
